.. _`Spectral (short time fourier) transform`: .. _`com.sympathyfordata.timeseriesanalysis.spectral_transform`: Spectral (short time fourier) transform ``````````````````````````````````````` .. image:: fourier.svg :width: 48 Computes a discrete short-time fourier transform on successive segments of the input data. Each analyzed frequency becomes one column and each segment becomes one row. Documentation ::::::::::::: Spectral transforms are important when we want to analyze the frequency content of non-stationary signals over time. For more information, see https://en.wikipedia.org/wiki/Short-time_Fourier_transform Methods ======= Short-time Fourier Transform (STFT) is a fourier releated transform used to determine the frequency content of local sections of time. More specifically, STFT splits the whole signal to shorter segment of equal length and computes the fourier transform on each segment. Spectogram is a visual representation of non stationary signal frequency content over time. It is the absolute square of the STFT To invert the transform select the istft method, also making sure to pass the output of stft. If "Add time column" is checked, it drops the first column which is considered as time column before applying the istft function. For more information about perfectly reconstructing a signal, see: https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.check_COLA.html Window functions ================ For more information on the different window functions, see `Window Function Catalog `_ Definition :::::::::: Input ports =========== **time domain** table time domain Output ports ============ **frequency domain** table frequency domain Configuration ============= **Boundary** (boundary) Specifies how to extend borders of the data so that the first segment is centered on the first data point **Select column** (column) Input data column to transform **Descriptive names** (descname) Generates output column names containing the frequency. Otherwise simple indices is used for each column **Detrend** (detrend) Performs detrending on each subset of the data before FFT. "constant" : the mean of the subset will be removed. "linear" : a least square linear expression is subtracted **Sample rate** (fs) Number of samples corresponding to one second **Method** (method) Select among fourier methods: "spectrogram" : spectral analysis (real valued), "stft" : short-time fourier transform (complex), "istft" : inverse short-time fourier transform (complex to real) **Segment length** (nperseg) Length of each subset **Overlap between segments** (overlap) Number of points to overlap between segments. Use segment length / 2 if transform should be invertible **Add time column** (segment_times) If checked, add a column with segment times. The time column will be the first column of the output table. **Window** (window) Window function applied to each segment, for details please refer to the node documentation. Related nodes ============= * :ref:`com.sympathyfordata.timeseriesanalysis.frequency_transform` * :ref:`com.sympathyfordata.imageanalysis.frequency_transform_image` * :ref:`com.sympathyfordata.timeseriesanalysis.continous_wavelet_transform` Examples ======== * :download:`Signal_demodulation.syx ` Implementation ============== .. automodule:: node_frequency :noindex: .. class:: SpectralTransform :noindex: